package com.jason.bookworm.service;

import com.jason.bookworm.dao.pojo.BorrowRecord;
import com.jason.bookworm.dao.pojo.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface BorrowRecordService {
    //新增借阅记录
    void addNewRecord(BorrowRecord borrowRecord);
    void addNewRecord(List<BorrowRecord> borrowRecordList);
    //获取该用户的所有借阅列表
    List<BorrowRecord> getAllRecords(User user);
    //获取某条记录
    BorrowRecord getRecord(Integer recordId);
    //获取借阅记录
    BorrowRecord getRecord(String username,Integer bookID);
    //还书(将status置为1)
    void returnBook(BorrowRecord borrowRecord);
    //删除借阅记录(将status置为2)
    void deleteRecord(BorrowRecord borrowRecord);
}
